package com.zq.server.api.service.impl;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zq.server.api.dao.ApiTeamMemberMapper;
import com.zq.server.api.domain.entity.ApiTeamMember;
import com.zq.server.api.service.IApiTeamMemberService;

/**
 * 战队成员Service业务层处理
 * 
 * @author 财哥
 * @date 2024-03-31
 */
@Service
public class ApiTeamMemberServiceImpl implements IApiTeamMemberService
{
    @Autowired
    private ApiTeamMemberMapper apiTeamMemberMapper;

    /**
     * 查询战队成员
     * 
     * @param id 战队成员主键
     * @return 战队成员
     */
    @Override
    public ApiTeamMember selectApiTeamMemberById(Long id)
    {
        return apiTeamMemberMapper.selectApiTeamMemberById(id);
    }

    /**
     * 查询战队成员列表
     * 
     * @param apiTeamMember 战队成员
     * @return 战队成员
     */
    @Override
    public List<ApiTeamMember> selectApiTeamMemberList(ApiTeamMember apiTeamMember)
    {
        return apiTeamMemberMapper.selectApiTeamMemberList(apiTeamMember);
    }

    /**
     * 新增战队成员
     * 
     * @param apiTeamMember 战队成员
     * @return 结果
     */
    @Override
    public int insertApiTeamMember(ApiTeamMember apiTeamMember)
    {
        apiTeamMember.setCreateTime(LocalDateTime.now());
        return apiTeamMemberMapper.insertApiTeamMember(apiTeamMember);
    }

    /**
     * 修改战队成员
     * 
     * @param apiTeamMember 战队成员
     * @return 结果
     */
    @Override
    public int updateApiTeamMember(ApiTeamMember apiTeamMember)
    {
        apiTeamMember.setUpdateTime(LocalDateTime.now());
        return apiTeamMemberMapper.updateApiTeamMember(apiTeamMember);
    }

    /**
     * 批量删除战队成员
     * 
     * @param ids 需要删除的战队成员主键
     * @return 结果
     */
    @Override
    public int deleteApiTeamMemberByIds(Long[] ids)
    {
        return apiTeamMemberMapper.deleteApiTeamMemberByIds(ids);
    }

    /**
     * 删除战队成员信息
     * 
     * @param id 战队成员主键
     * @return 结果
     */
    @Override
    public int deleteApiTeamMemberById(Long id)
    {
        return apiTeamMemberMapper.deleteApiTeamMemberById(id);
    }
}
